import { nanoid } from "nanoid";
import Doc from "../modal/doc";
export default function initData() {
    if (!window.utools) {
        return;
    }
    let res = window.utools.db.allDocs();
    res.forEach((item) => {
        window.utools.db.remove(item._id);
    });
    let doc = new Doc();
    doc.title = "test";
    doc.content = "testContent";
    doc.tags = ["hello"];
    let id = nanoid();
    window.utools.db.put({
        _id: id,
        data: doc,
    });
    let res2 = window.utools.db.allDocs();
    console.log(res2);
}